package edu.tju.moralManage;

import java.sql.SQLException;
import java.util.List;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.younker.waf.db.IBatisConfig;


public class IbatisRewardPunishDao implements IRewardPunishDao{
	protected SqlMapClient sqlMap = IBatisConfig.getSqlMapInstance();
	
	public void deleteRewardPunish(long id) throws SQLException {
		sqlMap.delete("deleteRewardPunish", id);
		
	}

	public RewardPunish getRewardPunishById(long id) throws SQLException {
		return (RewardPunish) sqlMap.queryForObject("getRewardPunishById", id);
	}

	public Long insertRewardPunish(RewardPunish rewardPunish)
			throws SQLException {
		return (Long)sqlMap.insert("insertRewardPunish", rewardPunish);
	}

	@SuppressWarnings("unchecked")
	public List<RewardPunish> getRewardPunishAnd(RewardPunish rewardPunish)
			throws SQLException {
		return sqlMap.queryForList("getRewardPunishAnd", rewardPunish);
	}

}
